home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 15 / BBS in a box XV-2.iso / Files II / Prog / D-G / FMAT Editor 1.0.1.sit / FMAT Editor 1.0.1 folder / FormatVal.c < prev    next >
MacBinary  |  1993-08-19  |  1.8 KB  |  [TEXT/KAHL]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Thu Aug 19 00:41:35 1993, modified Thu Aug 19 00:41:35 1993, creator Think C, type ASCII, 1172 bytes "FormatVal.c" , at 0x514 348 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[KAHL]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0b 46 6f 72 6d 61 74 | 56 61 6c 2e 63 00 00 00 |..Format|Val.c...|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4b 41 48 | 4c 01 00 00 00 00 00 00 |.TEXTKAH|L.......|
|00000050| 00 00 00 00 00 04 94 00 | 00 01 5c a8 98 b4 ff a8 |........|..\.....|
|00000060| 98 b4 ff 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 13 5e 00 00 |........|.....^..|
|00000080| 23 69 6e 63 6c 75 64 65 | 20 3c 50 61 63 6b 61 67 |#include| <Packag|
|00000090| 65 73 2e 68 3e 0d 0d 23 | 69 6e 63 6c 75 64 65 20 |es.h>..#|include |
|000000a0| 22 46 6f 72 6d 61 74 56 | 61 6c 2e 68 22 0d 0d 2f |"FormatV|al.h"../|
|000000b0| 2a 0d 09 2d 2d 20 4d 69 | 63 68 61 65 6c 20 48 65 |*..-- Mi|chael He|
|000000c0| 63 68 74 20 28 4d 69 63 | 68 61 65 6c 5f 48 65 63 |cht (Mic|hael_Hec|
|000000d0| 68 74 40 6d 61 63 2e 73 | 61 73 2e 63 6f 6d 29 0d |ht@mac.s|as.com).|
|000000e0| 09 20 20 20 41 75 67 75 | 73 74 20 35 2c 20 31 39 |. Augu|st 5, 19|
|000000f0| 39 33 0d 2a 2f 0d 0d 0d | 4f 53 45 72 72 20 46 6f |93.*/...|OSErr Fo|
|00000100| 72 6d 61 74 56 61 6c 28 | 20 64 6f 75 62 6c 65 20 |rmatVal(| double |
|00000110| 78 2c 20 73 68 6f 72 74 | 20 66 6f 72 6d 61 74 49 |x, short| formatI|
|00000120| 44 2c 20 53 74 72 69 6e | 67 50 74 72 20 66 6f 72 |D, Strin|gPtr for|
|00000130| 6d 61 74 74 65 64 58 20 | 29 0d 7b 0d 09 4e 75 6d |mattedX |).{..Num|
|00000140| 62 65 72 50 61 72 74 73 | 09 09 09 70 61 72 74 73 |berParts|...parts|
|00000150| 3b 0d 0d 09 4e 75 6d 46 | 6f 72 6d 61 74 53 74 72 |;...NumF|ormatStr|
|00000160| 69 6e 67 09 09 2a 2a 66 | 6f 72 6d 61 74 3b 0d 09 |ing..**f|ormat;..|
|00000170| 48 61 6e 64 6c 65 09 09 | 09 09 69 74 6c 34 3b 0d |Handle..|..itl4;.|
|00000180| 09 6c 6f 6e 67 09 09 09 | 09 6f 66 66 73 65 74 2c |.long...|.offset,|
|00000190| 20 6c 65 6e 67 74 68 3b | 0d 0d 09 46 6f 72 6d 61 | length;|...Forma|
|000001a0| 74 53 74 61 74 75 73 09 | 09 73 74 61 74 75 73 3b |tStatus.|.status;|
|000001b0| 0d 0d 0d 09 2f 2a 20 4a | 75 73 74 20 69 6e 20 63 |..../* J|ust in c|
|000001c0| 61 73 65 21 20 2a 2f 0d | 09 4c 65 6e 67 74 68 28 |ase! */.|.Length(|
|000001d0| 20 66 6f 72 6d 61 74 74 | 65 64 58 20 29 20 3d 20 | formatt|edX ) = |
|000001e0| 30 3b 0d 0d 09 2f 2a 20 | 47 65 74 20 64 65 66 61 |0;.../* |Get defa|
|000001f0| 75 6c 74 20 4e 75 6d 62 | 65 72 20 50 61 72 74 73 |ult Numb|er Parts|
|00000200| 20 72 65 73 6f 75 72 63 | 65 2f 6f 66 66 73 65 74 | resourc|e/offset|
|00000210| 2f 6c 65 6e 67 74 68 20 | 2a 2f 0d 09 47 65 74 49 |/length |*/..GetI|
|00000220| 6e 74 6c 52 65 73 6f 75 | 72 63 65 54 61 62 6c 65 |ntlResou|rceTable|
|00000230| 28 20 69 75 43 75 72 72 | 65 6e 74 53 63 72 69 70 |( iuCurr|entScrip|
|00000240| 74 2c 20 69 75 4e 75 6d | 62 65 72 50 61 72 74 73 |t, iuNum|berParts|
|00000250| 54 61 62 6c 65 2c 20 26 | 69 74 6c 34 2c 20 26 6f |Table, &|itl4, &o|
|00000260| 66 66 73 65 74 2c 20 26 | 6c 65 6e 67 74 68 20 29 |ffset, &|length )|
|00000270| 3b 0d 20 20 20 20 69 66 | 28 20 21 69 74 6c 34 20 |;. if|( !itl4 |
|00000280| 29 0d 09 09 72 65 74 75 | 72 6e 20 70 61 72 61 6d |)...retu|rn param|
|00000290| 45 72 72 3b 0d 0d 09 2f | 2a 20 52 65 74 72 69 65 |Err;.../|* Retrie|
|000002a0| 76 65 20 64 65 66 61 75 | 6c 74 20 4e 75 6d 62 65 |ve defau|lt Numbe|
|000002b0| 72 20 50 61 72 74 73 20 | 54 61 62 6c 65 20 2a 2f |r Parts |Table */|
|000002c0| 0d 09 70 61 72 74 73 20 | 3d 20 2a 28 20 4e 75 6d |..parts |= *( Num|
|000002d0| 62 65 72 50 61 72 74 73 | 50 74 72 20 29 28 20 2a |berParts|Ptr )( *|
|000002e0| 69 74 6c 34 20 2b 20 6f | 66 66 73 65 74 20 29 3b |itl4 + o|ffset );|
|000002f0| 0d 0d 09 2f 2a 20 52 65 | 74 72 69 65 76 65 20 63 |.../* Re|trieve c|
|00000300| 61 6e 6f 6e 69 63 61 6c | 20 66 6f 72 6d 61 74 20 |anonical| format |
|00000310| 2a 2f 0d 09 66 6f 72 6d | 61 74 20 3d 20 28 20 4e |*/..form|at = ( N|
|00000320| 75 6d 46 6f 72 6d 61 74 | 53 74 72 69 6e 67 20 2a |umFormat|String *|
|00000330| 2a 20 29 47 65 74 52 65 | 73 6f 75 72 63 65 28 20 |* )GetRe|source( |
|00000340| 27 46 4d 41 54 27 2c 20 | 66 6f 72 6d 61 74 49 44 |'FMAT', |formatID|
|00000350| 20 29 3b 0d 09 69 66 28 | 20 21 66 6f 72 6d 61 74 | );..if(| !format|
|00000360| 20 29 0d 09 09 72 65 74 | 75 72 6e 20 72 65 73 4e | )...ret|urn resN|
|00000370| 6f 74 46 6f 75 6e 64 3b | 0d 0d 09 2f 2a 20 4c 6f |otFound;|.../* Lo|
|00000380| 63 6b 20 69 74 20 2a 2f | 0d 09 48 4c 6f 63 6b 28 |ck it */|..HLock(|
|00000390| 28 20 48 61 6e 64 6c 65 | 20 29 66 6f 72 6d 61 74 |( Handle| )format|
|000003a0| 20 29 3b 0d 0d 09 2f 2a | 20 46 6f 72 6d 61 74 20 | );.../*| Format |
|000003b0| 69 74 21 20 2a 2f 0d 2f | 2f 09 54 68 69 73 20 73 |it! */./|/.This s|
|000003c0| 68 6f 75 6c 64 20 77 6f | 72 6b 20 69 6e 20 54 48 |hould wo|rk in TH|
|000003d0| 49 4e 4b 20 43 20 36 2e | 30 2c 20 62 75 74 20 69 |INK C 6.|0, but i|
|000003e0| 74 20 64 6f 65 73 6e 27 | 74 20 64 75 65 20 74 6f |t doesn'|t due to|
|000003f0| 20 61 6e 20 48 20 66 69 | 6c 65 20 65 72 72 6f 72 | an H fi|le error|
|00000400| 2e 20 54 68 65 72 65 66 | 6f 72 65 2c 0d 2f 2f 09 |. Theref|ore,.//.|
|00000410| 77 65 20 63 6f 65 72 63 | 65 20 78 20 69 6e 74 6f |we coerc|e x into|
|00000420| 20 61 6e 20 65 78 74 65 | 6e 64 65 64 38 30 2e 0d | an exte|nded80..|
|00000430| 2f 2f 09 73 74 61 74 75 | 73 20 3d 20 45 78 74 65 |//.statu|s = Exte|
|00000440| 6e 64 65 64 54 6f 53 74 | 72 69 6e 67 28 20 78 2c |ndedToSt|ring( x,|
|00000450| 20 2a 66 6f 72 6d 61 74 | 2c 20 26 70 61 72 74 73 | *format|, &parts|
|00000460| 2c 20 66 6f 72 6d 61 74 | 74 65 64 58 20 29 3b 0d |, format|tedX );.|
|00000470| 09 73 74 61 74 75 73 20 | 3d 20 45 78 74 65 6e 64 |.status |= Extend|
|00000480| 65 64 54 6f 53 74 72 69 | 6e 67 28 20 2a 28 20 65 |edToStri|ng( *( e|
|00000490| 78 74 65 6e 64 65 64 38 | 30 20 2a 20 29 26 78 2c |xtended8|0 * )&x,|
|000004a0| 20 2a 66 6f 72 6d 61 74 | 2c 20 26 70 61 72 74 73 | *format|, &parts|
|000004b0| 2c 20 66 6f 72 6d 61 74 | 74 65 64 58 20 29 3b 0d |, format|tedX );.|
|000004c0| 0d 09 2f 2a 20 55 6e 6c | 6f 63 6b 20 74 68 65 20 |../* Unl|ock the |
|000004d0| 63 61 6e 6f 6e 69 63 61 | 6c 20 66 6f 72 6d 61 74 |canonica|l format|
|000004e0| 20 2a 2f 0d 09 48 55 6e | 6c 6f 63 6b 28 28 20 48 | */..HUn|lock(( H|
|000004f0| 61 6e 64 6c 65 20 29 66 | 6f 72 6d 61 74 20 29 3b |andle )f|ormat );|
|00000500| 0d 0d 09 72 65 74 75 72 | 6e 20 73 74 61 74 75 73 |...retur|n status|
|00000510| 3b 0d 7d 0d 00 00 00 00 | 00 00 00 00 00 00 00 00 |;.}.....|........|
|00000520| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000530| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000540| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000550| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000560| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000570| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000580| 00 00 01 00 00 00 01 16 | 00 00 00 16 00 00 00 46 |........|.......F|
|00000590| 00 00 04 9a 0e 4c 6f 63 | 61 74 65 54 75 6e 65 55 |.....Loc|ateTuneU|
|000005a0| 70 2e 68 4c 02 00 00 00 | 54 45 58 54 4b 41 48 4c |p.hL....|TEXTKAHL|
|000005b0| 0b 46 6f 72 6d 61 74 56 | 61 6c 2e 63 02 00 00 00 |.FormatV|al.c....|
|000005c0| 54 45 58 54 4b 41 48 4c | 01 00 00 34 00 00 00 00 |TEXTKAHL|...4....|
|000005d0| 00 00 54 45 58 54 4b 41 | 48 4c 01 00 00 34 00 00 |..TEXTKA|HL...4..|
|000005e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005f0| 00 00 a8 86 11 26 00 00 | 04 94 00 00 01 5c 00 00 |.....&..|.....\..|
|00000600| 00 00 00 00 00 00 00 00 | 00 00 0f 00 00 00 04 9a |........|........|
|00000610| 09 4c 6f 67 67 69 6e 67 | 2e 63 02 00 00 00 54 45 |.Logging|.c....TE|
|00000620| 58 54 4b 41 48 4c 01 00 | ff ff ff ff 00 00 00 00 |XTKAHL..|........|
|00000630| 12 d4 00 00 00 00 0d c4 | 00 00 20 00 00 00 00 00 |........|.. .....|
|00000640| 01 5c 00 00 20 00 a8 0c | a8 5f a8 48 d0 cf 00 00 |.\.. ...|._.H....|
|00000650| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000660| 00 00 00 00 0d cf 00 01 | 00 00 00 00 00 00 00 00 |........|........|
|00000670| 0d d0 00 01 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000680| 00 00 00 04 00 06 00 04 | 00 00 00 0a 00 0a 07 43 |........|.......C|
|00000690| 6f 75 72 69 65 72 00 00 | 01 00 00 00 01 16 00 00 |ourier..|........|
|000006a0| 00 16 00 00 00 46 00 b5 | 01 78 1f 38 00 00 00 1c |.....F..|.x.8....|
|000006b0| 00 46 00 01 45 54 41 42 | 00 00 00 12 45 46 4e 54 |.F..ETAB|....EFNT|
|000006c0| 00 00 00 1e 03 ec ff ff | 00 00 00 00 00 b5 00 78 |........|.......x|
|000006d0| 03 eb ff ff 00 00 00 08 | 00 b4 ff 68 00 00 00 00 |........|...h....|
|000006e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+